#
# SPDX-License-Identifier: Apache-2.0
#
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: ibppeers.ibp.com
  labels:
    release: "operator"
    helm.sh/chart: "ibm-ibp"
    app.kubernetes.io/name: "ibp"
    app.kubernetes.io/instance: "ibppeer"
    app.kubernetes.io/managed-by: "ibp-operator"
spec:
  preserveUnknownFields: false
  conversion:
    strategy: Webhook
    webhookClientConfig:
      service:
        namespace: "{{ project | default(namespace) }}"
        name: ibp-webhook
        path: /crdconvert
      caBundle: "{{ webhook_tls_cert }}"
  validation:
    openAPIV3Schema:
      x-kubernetes-preserve-unknown-fields: true
  group: ibp.com
  names:
    kind: IBPPeer
    listKind: IBPPeerList
    plural: ibppeers
    singular: ibppeer
  scope: Namespaced
  subresources:
    status: {}
{%+ if product_version is version('2.5.1', '>=') %}
  version: v1beta1
{%+ else %}
  version: v1alpha2
{% endif %}
  versions:
{%+ if product_version is version('2.5.1', '>=') %}
  - name: v1beta1
    served: true
    storage: true
  - name: v1alpha2
    served: true
    storage: false
{%+ else %}
  - name: v1alpha2
    served: true
    storage: true
{% endif %}
  - name: v1alpha1
    served: true
    storage: false
